﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class CommentMovie : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btn_comment_Click(object sender, EventArgs e)
    {
        MembershipUser user = Membership.GetUser();

        if (user != null)
        {
            DVDTableAdapters.CommentTableAdapter ta = new DVDTableAdapters.CommentTableAdapter();
            ta.Insert(txt_comment.Text, System.DateTime.Now, (Guid)user.ProviderUserKey, Convert.ToInt32(FormView1.DataKey.Value));
            DVDTableAdapters.UserhistoryMovieTableAdapter ta1 = new DVDTableAdapters.UserhistoryMovieTableAdapter();
            ta1.UpdateComment(true, (Guid)user.ProviderUserKey, Convert.ToInt32(FormView1.DataKey.Value));
        }

    }
}